<template>
  <div id="wealth">
    <NavBar class="fixed nav" title="U利派" />
    <div class="bg fixed"></div>
    <div class="wealthBox">
      <div class="wealth-top">产品介绍</div>
      <div class="wealth-top2" v-html="product"></div>
      <div class="wealth-main">
        <div class="title">产品亮点</div>
        <div class="boxflex">
          <div class="text">
            <div>随存随取</div>
            <div>派息周期</div>
          </div>
          <div class="text">
            <div>每日下发</div>
            <div>活期利息</div>
          </div>
        </div>
        <Grid :border="false" :column-num="3">
          <GridItem v-for="item in productHighlights" :key="item.text">
            <img :src="item.icon" />
            <div>{{ item.text }}</div>
          </GridItem>
        </Grid>
      </div>
      <div class="wealth-main">
        <div class="title">举个例子</div>
        <div class="weight">收益计算</div>
        <div class="htmlData" v-html="earnings"></div>
      </div>
      <div class="wealth-main">
        <div class="weight">关于违约金</div>
        <div class="htmlData" v-html="defaultMsg"></div>
      </div>
    </div>
    <div class="wealth-btn" @click="to('/wealthList')">我要参与</div>
  </div>
</template>

<script>
import NavBar from '@/components/navbar'

import { Grid, GridItem } from 'vant'

export default {
  components: {
    NavBar,
    Grid,
    GridItem
  },
  data() {
    return {
      // 产品亮点
      productHighlights: [
        {
          icon: require('../../assets/images/ic_money_safe.3ada2187.png'),
          text: '100%资金安全保障'
        },
        {
          icon: require('../../assets/images/ic_money_pack.4130e6b1.png'),
          text: '节假日收益不间断'
        },
        {
          icon: require('../../assets/images/ic_money_pack.png'),
          text: '成功存入后当天起息'
        }
      ],
      // 产品介绍
      product:
        '<div><p>U利派是通过将USDT托管给平台，由平台的专业团队进行套利，参与者在资金托管期间可获得平台的收入分成。认购成功后，将每日结算活期收益，您可自由自配。托管资金在到期后将自动返还至您的账户。</p><p>【赎回】</p><p>托管资金可提前赎回，但需要支付一定比例的违约金。违约金=剩余天数*违约比例*托管资金</p><p>【风险提示】</p><p>平台不会以任何理由向您索要账号密码，请参与者自行管理好账号密码，谨防被骗和丢失风险。认购即表示您已理解并同意以上内容</p></div>',
      //  收益计算
      earnings:
        '<div><p> 会员在平台存入了10000U，选择了周期为7天，日收益率为0.3%~0.5%的理财产品，则每天的收益如下：</p><p>最低：10000U x 0.3%=30 U</p><p>最高：10000U x 0.5%=50 U</p><p>即：7天后可以获得210U~350U的收益，收益每日下发，下发的收益可随时存取，存入的本金，到期满后，自动返还至您的钱包账户。</p></div>',
      //  关于违约金
      defaultMsg:
        '<div><p> 若您希望转出未到期的本金，则会产生违约金，违约金=违约结算比例*剩余天数*投资数量。</p><p>举例：该产品的违约结算比例为0.4%，剩余3天到期，投资数量为1000，则违约金=0.4%*3*1000=12U，实际退还本金为1000U-12U=988U</p></div>'
    }
  },
  methods: {
    //跳转页面
    to(to) {
      this.$router.push({ path: to })
    }
  }
}
</script>

<style lang="less" scoped>
#wealth {
  .fixed {
    position: fixed;
    z-index: 0;
    top: 0;
  }
  .nav {
    width: 100%;
    z-index: 99;
  }
  .bg {
    background-color: #091731;
    height: 100%;
    width: 375px;
    background-image: url('../../assets/images/moveing_desc_bg.ac60782b.png');
    background-position: 0% 0%;
    background-size: 100% 100%;
    background-repeat: no-repeat;
    z-index: -1;
  }
  .wealth-btn {
    position: fixed;
    width: 95%;
    line-height: 46px;
    left: 2.5%;
    bottom: 20px;
    z-index: 999;
    background-color: #24acd4;
    text-align: center;
    color: #fff;
    border-radius: 5px;
    font-size: 18px;
  }
  .wealthBox {
    padding: 66px 20px 80px 20px;
    z-index: 1;
    color: #fff;
    .wealth-top {
      font-size: 18px;
      text-align: center;
      margin: 10px 0 40px;
    }
    .wealth-top2 {
      margin-bottom: 30px;
    }
    .wealth-main {
      color: #000;
      background-color: #fff;
      border-radius: 10px;
      padding: 15px;
      margin-bottom: 10px;
      font-size: 16px;
      .title {
        color: #007aff;
        font-weight: 800;
        text-align: center;
        margin-bottom: 15px;
      }
      .text {
        width: 50%;
        text-align: center;
        div:nth-child(1) {
          font-weight: 700;
          margin-bottom: 5px;
        }
        div:nth-child(2) {
          font-size: 12px;
        }
      }
      .van-grid {
        text-align: center;
        font-size: 12px;
        img {
          height: 40px;
          margin: 15px 0 10px;
        }
      }
      .weight {
        font-weight: 700;
      }
      .htmlData {
        font-size: 14px;
      }
    }
  }
}
</style>
